<% for (var i in arr) { %>
<dd activityId="<%= arr[i].activity_id %>">
    <div class="activitiesListAvatar" usrId="<%= arr[i].usr_id %>">
        <img height="60" width="60"  src="<%= arr[i].picture.icon %>" />
    </div>
    <% if(parseInt(arr[i].numberofpictures) > 0) { %>
    <div class="activitiesListPhotos">
        <span></span> <%= arr[i].numberofpictures %>
    </div>
    <% } %>
    <div class="activitiesListContent">
        <span class="activitiesDelete"></span>
        <strong class="activitiesListName" usrId="<%= arr[i].usr_id %>"><%= arr[i].username %></strong> <%= arr[i].activity_title %>
        <% if(typeof(arr[i].new_images) != 'undefined') { %>
        <div class="activitiesListPhoto">
            <% for (var x in arr[i].new_images) {%>
            <a class="activitiesListPhotoL">
                <img height="100" width="100"  src="<%= arr[i].new_images[x].picture %>" />
            </a>
            <% } %>
        </div>
        <% } %>
        <div class="ContentBox"><%= arr[i].activity_desc %></div>
    </div>
    <div class="activitiesOperation">
         <span class="activitiesLike <%if(parseInt(arr[i].liked) == 1){%>activitiesLiked<%}%>">Like</span>
         <span class="activitiesComment">Comment</span>
    </div>
    <% if(arr[i].likers.length > 0 ) { %>
    <div class="activitiesPraise">
        <span><b></b></span>
        <% for (var k in arr[i].likers) { %>
        <a userid="<%= arr[i].likers[k].usr_id %>" title="<%= arr[i].likers[k].username %>"><img width="30" height="30" src="<%= arr[i].likers[k].icon %>"></a>
        <% } %>
    </div>
    <% } %>
    <% if(arr[i].comments.length > 0) { %>
    <ul class="activitiesCommentList">
        <% for (var j in arr[i].comments) { %>
        <li>
            <div class="activitiesCommentAvatar">
                <img height="30" width="30"  src="<%= arr[i].comments[j].user_basic_profile.picture.picture %>" />
            </div> 
            <h5>
                <div><%= arr[i].comments[j].user_basic_profile.username%></div>
                <span>Posted on <%= arr[i].comments[j].date.split(' ')[0]%></span>
            </h5>
            <div class="activitiesCommentContent">
                <%= arr[i].comments[j].text %>
            </div>
        </li>
        <% } %>
    </ul>
    <% } %>
</dd>
<% } %>